@extends('backend::layout')
@section('title',$page_title)
@section('content')
    @if(isset($search))
        {{$search->render()}}
    @endif
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <div class="table-responsive">
                    <table class="list table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>
                                @component('backend::component.checkbox')
                                    @slot('name') ids-all @endslot
                                @endcomponent
                            </th>
                            <th>申请人</th>
                            <th>申请数量</th>
                            <th>账户</th>
                            <th>申请时间</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($list as $item)
                            <tr>
                                <td class="text-truncate">
                                    @component('backend::component.checkbox')
                                        @slot('name') wd_id[] @endslot
                                        @slot('class') id @endslot
                                        @slot('value') {{$item->id}} @endslot
                                    @endcomponent
                                </td>
                                <td class="text-truncate text-more-hide">
                                    {{$item->user->user_number}}[{{$item->user->real_name}}]<br/>
                                    {{$item->user->user_phone}}
                                </td>
                                <td>
                                    申请金额:{{$item->money+$item->service_fee}}<br/>
                                    手续费:{{$item->service_fee}}<br/>
                                    实发金额:{{$item->money}}
                                </td>
                                <td>
                                    收款<br/>
                                    <div class="px-3">{!! format_json($item->to_account) !!}</div>
                                    @if($item->status==1)
                                        汇款<br/>
                                        <div class="px-3">{!! format_json($item->from_account) !!}</div>
                                    @endif
                                </td>
                                <td>
                                    申请时间:{{$item->created_at}}<br/>
                                    @if($item->status!=0)
                                        处理时间:{{$item->handled_at}}
                                    @endif
                                </td>
                                <td>
                                    @switch($item->status)
                                        @case(1) 已审批 @break
                                        @case(-1) 拒绝 @break
                                        @default 待审核
                                    @endswitch
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    @slot('list_page')
                        {{$list->appends($search->getSearchData())->links('backend::public.pagination')}}
                    @endslot
                </div>
            @else
                @include('backend::public.empty_page',['info'=>'暂时没有提现申请'])
            @endif
        @endslot
    @endcomponent
@endsection